<template>
    <h3>Parent</h3>
    <!-- title 静态数据； msg 动态传递数据 -->
    <Child title="Parent数据" :msg="message" :age="age" :arrNames="arrNames" :userInfo="userInfo" />
    <hr />
    <Child2 :title="title" :age="age" :onEvent="DataFn" />
    <p>子级传过来的数据：{{ ChildData }}</p>
</template>
<script>
import Child from './Child.vue'
import Child2 from './Child2.vue'

export default {
    data() {
        return {
            title: 201,
            message: "wo",
            age: 20,
            arrNames: ["Mike", "Frank", "John"],
            userInfo: {
                name: "Tom",
                age: 25
            },
            ChildData: "",
        }
    },
    components: {
        Child,
        Child2
    },
    methods: {
        DataFn(data) {
            this.ChildData = data;
        }
    }
}
</script>
